import type { RouteParamValueRaw } from "#vue-router";
import { useRouteQuery } from "@vueuse/router";

/**
 * 获取路由参数Query
 * @param name 参数名
 * @param defaultVal 默认值
 */
export default function useAppRouteQuery<T extends RouteParamValueRaw>(name: string, defaultVal?: T) {
    return useRouteQuery<T>(name, defaultVal, { mode: 'push' });
}